﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PetaPoco;
using Meraz.Core.Model;
using Ninject;

namespace Meraz.Core.Repositories
{
    public interface IFacebookTopicBoardRepository : IRepository<FacebookTopicBoard, long> { }
    public class FacebookTopicBoardRepository : IFacebookTopicBoardRepository
    {
        [Inject]
        public Database DB { get; set; }
        #region IRepository<FacebookTopicBoard,long> Members

        public FacebookTopicBoard GetById(long id)
        {
            return DB.SingleOrDefault<FacebookTopicBoard>("where id=@0", id);
        }

        public void Add(FacebookTopicBoard entity)
        {
            throw new NotImplementedException();
        }

        public void Delete(FacebookTopicBoard entity)
        {
            throw new NotImplementedException();
        }

        public List<FacebookTopicBoard> All()
        {
            return DB.Query<FacebookTopicBoard>("select * from facebookboard").ToList();
        }

        public Data.IMerazContext context
        {
            get { throw new NotImplementedException(); }
        }

        #endregion
    }
}
